package com.tomek.ktoryoperator.providers;

import java.util.LinkedHashMap;
import java.util.Map;

public class ProvidersFactory {
	private static ProvidersFactory _instance;

	private Map<String, NumberInfoProvider> infoProviders;

	private ProvidersFactory() {
		loadProviders();
	}

	public static ProvidersFactory getInstance() {
		if (_instance == null) {
			_instance = new ProvidersFactory();
		}

		return _instance;
	}

	public Map<String, NumberInfoProvider> getInfoProviders() {
		return infoProviders;
	}

	private void loadProviders() {
		infoProviders = new LinkedHashMap<String, NumberInfoProvider>();

		// NumberInfoProvider nip1 = new EraNetNumberInfoProvider();
		NumberInfoProvider nip2 = new EraNetOmnixNumberInfoProvider();
		NumberInfoProvider nip3 = new PolishLandlineNumberInfoProvider();

		infoProviders.put(nip3.getProviderId(), nip3);
		infoProviders.put(nip2.getProviderId(), nip2);
		// infoProviders.put(nip1.getProviderName(), nip1);
	}
}
